package cn.fl.project.service.impl;

import cmm.mid.core.framework.page.Pager;
import cn.cmm.base.framework.exception.BaseException;
import cn.cmm.base.framework.utils.CollectionUtils;
import cn.cmm.base.framework.utils.StringUtils;
import cn.fl.preloan.enums.LogBusinessTypeEnum;
import cn.fl.project.condition.PrjQuatPrpsPaySchQueryCondition;
import cn.fl.project.dto.PrjQuatPrpsPaySchDTO;
import cn.fl.project.service.IPrjQuatPrpsPaySchService;
import cn.fl.project.service.IProjectApiService;
import cn.fl.project.transform.PrjQuatPrpsPaySchVOTransform;
import cn.fl.project.vo.PrjQuatPrpsPaySchVO;
import com.alibaba.fastjson.JSON;
import com.lionbridge.log.ext.ExtSlf4jLogger;
import com.lionbridge.log.ext.ExtSlf4jLoggerBuilder;
import com.lionbridge.log.ext.LogTypeEnum;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Description: 项目报价方案-支付表信息表 客户端服务层接口实现
 * @Description: 业务层方法名称前缀：新增：add* 删除：remove* 修改：modify* 查询对象：select* get* 批量：batch* 查询集合：search*
 */
@Slf4j
@Service
public class PrjQuatPrpsPaySchServiceImpl implements IPrjQuatPrpsPaySchService {
	private static ExtSlf4jLogger logger = ExtSlf4jLoggerBuilder.create()
			.setLogger(log).setBusinessType(LogBusinessTypeEnum.QUOTATION_SCHEME.getCode())
			.setSubBusinessType(LogBusinessTypeEnum.QUOTATION_SCHEME.getCode())
			.setLogType(LogTypeEnum.BUSINESS).build().setKeywords("PrjQuatPrpsPaySch");
	/**
	 * TODO 自定义 API 暴露服务
	 */
	//@Autowired
	private IProjectApiService projectApiService;

	@Override
	public PrjQuatPrpsPaySchVO selectById(Long id) throws BaseException{
		if(StringUtils.isEmpty(id)){
			return null;
		}
		PrjQuatPrpsPaySchDTO dto = null;//this.自定义ApiService.selectById(id);
		return PrjQuatPrpsPaySchVOTransform.toVO(dto);
	}

	@Override
	public Long add(PrjQuatPrpsPaySchVO entity) throws BaseException{
		if(null == entity){
			return null;
		}
		return null;
	}

	@Override
	public boolean removeById(Long id) throws BaseException{
		if(StringUtils.isEmpty(id)){
			return false;
		}
		return false;
	}
	
	/**
     * 删除
     * @param ids
     * @return
     */
    public boolean removeByIds(List<Long> ids)throws BaseException{
    	if(CollectionUtils.isEmpty(ids)){
			return false;
		};
		return false;
    }

	@Override
	public boolean modify(PrjQuatPrpsPaySchVO entity) throws BaseException{
		if(null == entity){
			return false;
		}
		return false;
	}

	@Override
	public Pager searchListPage(Pager page) throws BaseException{
		if(null == page)page = new Pager();
		return null;
	}

	@Override
	public List<PrjQuatPrpsPaySchVO> searchList(PrjQuatPrpsPaySchQueryCondition prjQuatPrpsQc) throws BaseException {
		if(null==prjQuatPrpsQc) return null;
		logger.info("查询报价方案还款计划，查询条件:{}", JSON.toJSON(prjQuatPrpsQc));
		return PrjQuatPrpsPaySchVOTransform.toVOList(this.projectApiService.searchPrjQuatPrpsPaySchList(prjQuatPrpsQc));
	}
}
